package com.example.demo1;

public class DemoTest {

    /**
     * 适配器模式
     * @param args
     */
    public static void main(String[] args) {

        // =======================第一种适配器模式  对象适配器
        //SDCard sdCard = new SDCardImpl();

//        TFCard tfCard = new TFCardImpl();
//
//        SDCard sdCard = new SDAdapterTF(tfCard);
//
//        Computer computer = new Computer();
//        String read = computer.read(sdCard);

        // =======================类适配器
        SDCard sdCard1 = new SDadpterTF1();
        Computer computer1 = new Computer();
        String read1 = computer1.read(sdCard1);

    }
}
